#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}


//此槽函数是用来当文本被选中或取消时触发
void Widget::on_textEdit_copyAvailable(bool b)
{
    qDebug()<<"copyAvailable:"<<b;
}

//此槽函数是用来当光标移动时触发
void Widget::on_textEdit_cursorPositionChanged()
{
    QTextCursor cur=ui->textEdit->textCursor();//获取当前的光标情况
    qDebug()<<"cursorPositionChanged:"<<cur.position();
}

//此槽函数是用来当redo可用时触发
void Widget::on_textEdit_redoAvailable(bool b)
{
    qDebug()<<"redoAvailable:"<<b;
}

//此槽函数是用来当选中范围改变时触发
void Widget::on_textEdit_selectionChanged()
{
     QTextCursor cur=ui->textEdit->textCursor();//获取当前的光标情况
    qDebug()<<"selectionChanged:"<<cur.selectedText();
}

//此槽函数是用来当undo可用时触发
void Widget::on_textEdit_undoAvailable(bool b)
{
    qDebug()<<"undoAvailable:"<<b;

}
